package com.ls.fw.search.solrj.service;

import com.ls.fw.search.solrj.support.search.FacetedSearchRequest;
import com.ls.fw.search.solrj.support.search.SearchParameter;
import com.ls.fw.search.solrj.support.search.SearchRequest;
import com.ls.fw.search.solrj.support.search.SearchResponse;

/**
 * @param <T> the type of returned results
 * @param <P> the supported search parameter enumeration
 * @param <R> the supported search request type. For faceted searches this needs to extend {@link FacetedSearchRequest}
 */
public interface SearchService<T, P extends Enum<?> & SearchParameter, R extends SearchRequest<P>> {

  /**
   * Issues a SearchRequest and retrieves a response resulting of the search operation.
   * The actual result information will contain a list elements of type T.
   *
   * @param searchRequest the searchRequest that contains the search parameters
   *
   * @return the SearchResponse resulting of the search operation
   */
  SearchResponse<T, P> search(R searchRequest);

}
